﻿// CPeakSpeDlg.cpp: 实现文件
//

#include "stdafx.h"
#include "DC-QC.h"
#include "CPeakSpeDlg.h"
#include "afxdialogex.h"


// CPeakSpeDlg 对话框

IMPLEMENT_DYNAMIC(CPeakSpeDlg, CDialogEx)

CPeakSpeDlg::CPeakSpeDlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_PEAKSPEDLG, pParent)
{
	m_nCurID = -1;
}

CPeakSpeDlg::~CPeakSpeDlg()
{
}

void CPeakSpeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_PA1, m_dPA1);
	DDX_Text(pDX, IDC_PA2, m_dPA2);
	DDX_Text(pDX, IDC_PB1, m_dPB1);
	DDX_Text(pDX, IDC_PB2, m_dPB2);
}


BEGIN_MESSAGE_MAP(CPeakSpeDlg, CDialogEx)
	ON_EN_SETFOCUS(IDC_PA1, &CPeakSpeDlg::OnEnSetfocusPa1)
	ON_EN_SETFOCUS(IDC_PA2, &CPeakSpeDlg::OnEnSetfocusPa2)
	ON_EN_SETFOCUS(IDC_PB1, &CPeakSpeDlg::OnEnSetfocusPb1)
	ON_EN_SETFOCUS(IDC_PB2, &CPeakSpeDlg::OnEnSetfocusPb2)
END_MESSAGE_MAP()


// CPeakSpeDlg 消息处理程序


void CPeakSpeDlg::OnEnSetfocusPa1()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nCurID == IDC_PA1) return;
	m_nCurID = IDC_PA1;
	CString strTemp;
	CRect rt;
	GetDlgItem(IDC_PA1)->GetWindowRect(rt);
	//strTemp = gl.StartNumberKeyBoard(rt.left, rt.top + 20, strTemp);
	if (strTemp.GetLength()>0)
	{
		GetDlgItem(IDC_PA1)->SetWindowTextW(strTemp);
	}
}


void CPeakSpeDlg::OnEnSetfocusPa2()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nCurID == IDC_PA2) return;
	m_nCurID = IDC_PA2;
	CString strTemp;
	CRect rt;
	GetDlgItem(IDC_PA2)->GetWindowRect(rt);
	//strTemp = gl.StartNumberKeyBoard(rt.left, rt.top + 20, strTemp);
	if (strTemp.GetLength()>0)
	{
		GetDlgItem(IDC_PA2)->SetWindowTextW(strTemp);
	}
}


void CPeakSpeDlg::OnEnSetfocusPb1()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nCurID == IDC_PB1) return;
	m_nCurID = IDC_PB1;
	CString strTemp;
	CRect rt;
	GetDlgItem(IDC_PB1)->GetWindowRect(rt);
	//strTemp = gl.StartNumberKeyBoard(rt.left, rt.top + 20, strTemp);
	if (strTemp.GetLength()>0)
	{
		GetDlgItem(IDC_PB1)->SetWindowTextW(strTemp);
	}
}


void CPeakSpeDlg::OnEnSetfocusPb2()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nCurID == IDC_PB2) return;
	m_nCurID = IDC_PB2;
	CString strTemp;
	CRect rt;
	GetDlgItem(IDC_PB2)->GetWindowRect(rt);
	//strTemp = gl.StartNumberKeyBoard(rt.left, rt.top + 20, strTemp);
	if (strTemp.GetLength()>0)
	{
		GetDlgItem(IDC_PB2)->SetWindowTextW(strTemp);
	}
}
